package com.limingfeiyu.platform.management;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.limingfeiyu.common.config.RedisConfig;
import com.limingfeiyu.common.utils.RedisCache;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @Author: 黎铭飞羽
 * @Data: 2024-02-29 :   18:29
 * @Description: 平台管理应用
 */
@SpringBootApplication
@EnableSwagger2
@Import({RedisConfig.class, RedisCache.class})
public class PlatformManagementApplication {
    public static void main(String[] args) {
        SpringApplication.run(PlatformManagementApplication.class, args);
    }

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        // 创建拦截器
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        // 添加内部拦截器
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        // 添加多个内部拦截器
        return mybatisPlusInterceptor;
    }

}
